home *** CD-ROM | disk | FTP | other *** search
/ boe.pres.k12.wv.us / boe.pres.k12.wv.us.zip / boe.pres.k12.wv.us / Utilities / Xerox Workcentre 5335 / Windows Scan / 64-bit_x64 / Russian / cpsimage.cab / data / documentio.ucm < prev    next >
Text File  |  2009-04-23  |  19KB  |  314 lines

  1. # $Id: documentio.ucm,v 1.45 2009/03/16 16:25:03 isimmons Exp $
  2. #
  3. # DocumentReader and Document writer objects
  4. # These objects are used to read and write multi-page documents
  5. # to and from XIPIMAGE objects
  6. #
  7. # For a description of how this file works, see Appendix C of 
  8. # Architecture document at XIPS web page.
  9. # http://codex.xerox.com/projects/xips or
  10. # http://www.wrc.xerox.com/~campanel/xips
  11. #
  12.  
  13. <OBJECTS>
  14.  
  15.  
  16. [DOCUMENTIO]
  17. private: iohandle      "void* private"      Desc=Private handle used with IO lib
  18. private: filename      STRING               Desc=Name of source file
  19. private: format        INTEGER              Desc=Type of file format
  20. private: version       INTEGER              Desc=The subtype or version of the format
  21. private: pagecnt       INTEGER              Desc=Number of pages in the document
  22. private: testfile      BOOLEAN              Desc=remove variable data for checksum
  23.  
  24.  
  25. [DOCUMENTREADER]
  26. parent: DOCUMENTIO
  27. private: fngetpagecnt  "void* private"      Desc=Private overload function for getPageCount
  28. private: fngetchecksum "void* private"      Desc=Private overload function for getChecksum
  29. private: fngetpage     "void* private"      Desc=Private overload function for getPage
  30. private: fnrelease     "void* private"      Desc=Private overload function for release
  31.  
  32.  
  33. method:  getChecksum   Native=DocReadChecksum@documentio \
  34.                        Output=sum.INTEGER \
  35.                        Desc=Calculate a checksum for the document.
  36. method:  getFilename   Native=DocReadMethods@documentio \
  37.                        Output=filename.STRING \
  38.                        Desc=Return the filename of the backing data
  39. method:  getFormat     Native=DocReadMethods@documentio \
  40.                        Output=format.STRING, subtype.STRING \
  41.                        Desc=Return the format of the backing data
  42. method:  getPageCount  Native=DocReadMethods@documentio \
  43.                        Output=num.INTEGER \
  44.                        Desc=Return the number of pages in the document.
  45. method:  getPage       Native=DocReadMethods@documentio \
  46.                        Input=pgnum.INTEGER \
  47.                        Output=img.XIPIMAGE \
  48.                        Desc=Make an XIPImage from the requested page. The first\
  49.                        page is 1. Data is the raw (i.e. compressed) file data.
  50. method:  release       Native=DocReadMethods@documentio \
  51.                        Desc=Release all resources used by this object. Close the\
  52.                        backing store (i.e. file).
  53. method:  query         Native=DocQuery@documentio \
  54.                        Input=name.STRING,  \
  55.                        Output=results.LIST \
  56.                        Desc=Query a reader to see if it contains something.
  57.  
  58. desc: {
  59. // DESCRIPTION
  60.    A DOCUMENTREADER is a high-level representation of a document source. It provides
  61. access to information and pages of a file that contains a document. A reader may be created
  62. using the function CreateDocumentReader. A reader may be constructed from a filename.
  63. DOCUMENTREADER is a simple interface to several file formats which include PDF (with limits),
  64. Microsoft XPS, TIFF, JPEG (JFIF), PNG, GIF, and BMP.
  65. }
  66.  
  67. [DOCUMENTWRITER]
  68. parent: DOCUMENTIO
  69. private: fnsetattr     "void* private"      Desc=Private overload function for SetAttributes
  70. private: fnappendpage  "void* private"      Desc=Private overload function for appendPage
  71. private: fninsertpage  "void* private"      Desc=Private overload function for insertPage
  72. private: fnrelease     "void* private"      Desc=Private overload function for release
  73. private: transspecs    "struct _ELFLIST*"   Desc=List of TRANSFORMSPEC objects that describe \
  74.                                             acceptable specifications for pages to be appended.
  75. private: attributes    "struct _ELFLIST*"   Desc=List of attributes, both document model and format \
  76.                                             specific. Attributes include those used for the \
  77.                                             container, the page, and individual objects on a page.
  78. method:  getFilename   Native=DocWriteMethods@documentio \
  79.                        Output=filename.STRING \
  80.                        Desc=Return the filename of the backing data
  81. method:  getFileSize   Native=DocWriteMethods@documentio \
  82.                        Output=size.INTEGER \
  83.                        Desc=Return the current size of actual file
  84. method:  getFormat     Native=DocWriteMethods@documentio \
  85.                        Output=format.STRING, subtype.STRING \
  86.                        Desc=Return the format of the backing data
  87. method:  getPageCount  Native=DocWriteMethods@documentio \
  88.                        Output=num.INTEGER \
  89.                        Desc=Return the number of pages added to the document.
  90. method:  listSpecs     Native=DocWriteMethods@documentio \
  91.                        Output=speclist.LIST\
  92.                        Desc=Return a list of one or mode specification lists for this writer.
  93. method:  refSpecs      Native=DocWriteMethods@documentio \
  94.                        Output=speclist.LIST\
  95.                        Desc=Return a reference to the internal list specification lists.
  96. method:  setAttr       Native=DocWriteMethods@documentio \
  97.                        Input=name.STRING, obj.OBJECT \
  98.                        Desc=Set named parameters into to object \
  99.                        attributes. If the name is already there, it will be \
  100.                        replaced with the new value.
  101. method:  getAttr       Native=DocWriteMethods@documentio \
  102.                        Input=name.STRING \
  103.                        Output=obj.OBJECT \
  104.                        Desc=Get the named attribute. If no name \
  105.                        is passed in,the entire list is returned;
  106. method:  clearAttr     Native=DocWriteMethods@documentio \
  107.                        Input=name.STRING \
  108.                        Desc=Clear the named attribute. If no name\
  109.                        is passed in, the entire list is removed;
  110. method:  appendPage    Native=DocWriteMethods@documentio \
  111.                        Input=pgImg.XIPIMAGE \
  112.                        Output=num.INTEGER \
  113.                        Desc=Add this XIPImage at the end of the current document.\
  114.                        Return the total count of pages including this page.
  115. method:  insertPage    Native=DocWriteMethods@documentio \
  116.                        Input=pgImg.XIPIMAGE \
  117.                        Output=num.INTEGER \
  118.                        Desc=Add this XIPImage at the beginning of the current document.\
  119.                        Return the total count of pages including this page.
  120. method:  release       Native=DocWriteMethods@documentio \
  121.                        Desc=Release all resources used by this object. Close the\
  122.                        backing store (i.e. file).
  123.  
  124. method:  releaseJbig2  Native=DocWriteMethods@documentio \
  125.                        Desc=Release all JBIG2 resources used by this object. \
  126.                        Flushes the JBIG2 entities and frees the JBIG2 codec \
  127.                        handle. \
  128.  
  129. desc: {
  130. // DESCRIPTION
  131.    A DOCUMENTWRITER is a high-level representation of a document sink. Once constructed,
  132. it allows control over a few basic attributes, some of which are format related. It also allows
  133. scripted code to append pages (XIPIMAGE). It is assumed that the pages will prepared as
  134. needed prior to appending to the writer. With the exception of compression, the various
  135. embedded writers are not capable of significant processing. The current set of attributes
  136. are listed in Doc Attributes page of the Document Mgr section.
  137.  
  138. Each DOCUMENTWRITER contains a LIST of one or more TRANSFORMSPEC objects. The TRANSFORMSPEC
  139. provides information about the ability of the associated file format to contain page content.
  140. For example, a JFIF file is limited to contone image data, it can only carry JPEG compressed
  141. data, it can be of any width and height, it can not carry mixed raster content, etc.
  142.  
  143. The format specific information within a TRANSFORSPEC is not human friendly. Typically, the
  144. specification is used with the TransformPage funtion to prepare a XIPIMAGE prior to appending
  145. it to the DOCUMENTWRITER.
  146.  
  147. A writer may be constructed from as little as a filename using CreateDocumentWriter function.
  148. Several file formats are currently supported: PDF, Microsoft XPS, TIFF, JPEG (JFIF), PNG, GIF,
  149. and BMP.
  150. }
  151.  
  152. [FONTDIO]
  153. private: fntHnd    "void* private"      Desc=Private handle used in C code
  154.  
  155. method: getName    Native=FontDioMethods@documentio \
  156.                      Output=name.STRING \
  157.                      Desc=Get the name used in text commands for this font
  158. method: getSrcID   Native=FontDioMethods@documentio \
  159.                      Output=name.STRING \
  160.                      Desc=Get the unique ID that identifies this font in the source
  161.  
  162. desc: {
  163. // DESCRIPTION
  164.    A FONTDIO is the representation of a font. A font object may be associated with text. It is
  165. usually constructed and associated by the DOCUMENTREADER. Currently, the primary use is internal
  166. to the DOCUMENTWRITER.
  167. }
  168.  
  169.  
  170. [TRANSFORMSPEC]
  171. private: coreImage   "struct _ELFPOINTER*" Desc=ptr to core imaging specifications.
  172. private: attributes  "struct _ELFLIST*" Desc=General attributes
  173.  
  174. method: initByImage  Native=TransformSpecMethods@documentio \
  175.                      Input=image.XIPIMAGE \
  176.                      Desc=Set the core specifications to match a given image.
  177. method: matchList    Native=TransformSpecMethods@documentio \
  178.                      Input=speclist.LIST \
  179.                      Output=nearmatch.TRANSFORMSPEC, exact.BOOLEAN \
  180.                      Desc=Compare each TRANSFORMSPEC found in the input list to the \
  181.                           specifications of this object and return the nearest match. \
  182.                           The value return for exact is true if this is an exact match. \
  183.                           Rules for matching; (1) Any named item in this object not found \
  184.                           in a TRANSFORMSPEC of the speclist is assumed exact match. (2) Any \
  185.                           named item in a TRANSFORM SPEC of the speclist but not in this spec \
  186.                           is assumed acceptable but not an exact match.
  187. method: toList       Native=TransformSpecMethods@documentio \
  188.                      Output=list.LIST \
  189.                      Desc=Return a list that contains all of the specifications of this object.
  190.  
  191. method:  setAttr     Native=TransformSpecMethods@documentio \
  192.                      Input=name.STRING, obj.OBJECT \
  193.                      Desc=Set named parameters into to object \
  194.                      attributes. If the name is already there, it will be \
  195.                      replaced with the new value.
  196. method:  getAttr     Native=TransformSpecMethods@documentio \
  197.                      Input=name.STRING \
  198.                      Output=obj.OBJECT \
  199.                      Desc=Get the named attribute. If no name \
  200.                      is passed in,the entire list is returned
  201. method:  clearAttr   Native=TransformSpecMethods@documentio \
  202.                      Input=name.STRING \
  203.                      Desc=Clear the named attribute. If no name\
  204.                      is passed in, the entire list is removed;
  205. method:  isMRC       Native=SpecIsMRC@documentio \
  206.                      Output=hasmrc.BOOLEAN \
  207.                      Desc=Find out if this one has multiple layers
  208.  
  209. method:  setPageSpec Native=TransformSpecPage@documentio \
  210.                      Input=mrc.BOOLEAN, singlePagePerFile.BOOLEAN, \
  211.                      portrait.BOOLEAN, landscape.BOOLEAN \
  212.                      Desc=Set core values for the page specifications. One or more values \
  213.                      may be given. All others will remain unchanged.
  214. method:  setRasterSpec Native=TransformSpecRasters@documentio \
  215.                      Input=maxBitDepth.INTEGER, disallow.BOOLEAN, maxXRes.INTEGER, maxYRes.INTEGER, \
  216.                      photometry.LIST, compression.INTEGER, jpegquality.INTEGER, jbig2arith.BOOLEAN, \
  217.                      interleave.INTEGER, width.INTEGER, height.INTEGER \
  218.                      Desc=Set core values for the page rasters. maxBitDepth is required (1, 8, 24). \
  219.                      It will determine if the other given values apply to binary or contone rasters.\
  220.                      To disallow either binary or contone, use the disallow flag. Any other given \
  221.                      value will force that type of raster to be enabled. See XIPS defined constants \
  222.                      for valid values used with compression, photometry, and interleave. Jpegquality \
  223.                      may be 0..100. jbig2arith = TRUE will cause arithmetic coding to be used when \
  224.                      JBIG2 compression is done.
  225.  
  226. method:  testPhotom  Native=TransformSpecMethods@documentio \
  227.                      Input=photometry.INTEGER \
  228.                      Output=isMatch.BOOLEAN \
  229.                      Desc=Test this TRANSFORMSPEC for a match with the given Photometry.
  230.  
  231. method:  testDepth   Native=TransformSpecMethods@documentio \
  232.                      Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN, reduce.BOOLEAN \
  233.                      Output=needed.BOOLEAN, result.TRANSFORMSPEC  \
  234.                      Desc=Test inSpec against this specification to know if bit depth \
  235.                      adjustment is needed. If reduce is TRUE, bit depth reduction is tested, \
  236.                      otherwise test for expanding bit depth (i.e 1 bit to 8).
  237. method:  testOrient  Native=TransformSpecMethods@documentio \
  238.                      Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN, degrees.INTEGER \
  239.                      Output=needed.BOOLEAN, result.TRANSFORMSPEC, amount.INTEGER  \
  240.                      Desc=Test inSpec against this specification to find amount of rotation \
  241.                      needed to correct orientation.
  242. method:  testCompress  Native=TransformSpecMethods@documentio \
  243.                      Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN, decode.BOOLEAN \
  244.                      Output=needed.BOOLEAN, result.TRANSFORMSPEC, cinfo.LIST  \
  245.                      Desc=Test inSpec against this specification to determine if any compression \
  246.                      is needed. If decode is TRUE, this will test for the need to decompress.
  247. method:  testFlat    Native=TransformSpecMethods@documentio \
  248.                      Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
  249.                      Output=needed.BOOLEAN, result.TRANSFORMSPEC \
  250.                      Desc=Test inSpec against this specification to determine if flatten is needed.
  251. method:  testSegment Native=TransformSpecMethods@documentio \
  252.                      Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
  253.                      Output=needed.BOOLEAN, config.STRING, result.TRANSFORMSPEC \
  254.                      Desc=Test inSpec against this specification to determine if segmentation is needed.
  255. method:  testSize    Native=TransformSpecMethods@documentio \
  256.                      Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
  257.                      Output=needed.BOOLEAN, result.TRANSFORMSPEC, sfact.DOUBLE, \
  258.                      xsize.INTEGER, ysize.INTEGER, xres.DOUBLE, yres.DOUBLE \
  259.                      Desc=Test inSpec against this specification to determine if scale/rescon is \
  260.                      needed. The return values reflect the resultant size and resolution required.
  261. method:  testAffine  Native=TransformSpecMethods@documentio \
  262.                      Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
  263.                      Output=needed.BOOLEAN, result.TRANSFORMSPEC \
  264.                      Desc=Test inSpec against this specification to determine if affine is needed.
  265.  
  266. desc: {
  267. // DESCRIPTION
  268.    The TRANSFORMSPEC is used to describe various aspects of a page with respect to a file
  269. format writer, i.e. DOCUMENTWRITER. Currently, the specification focus is on a few page items
  270. and the specification of raster layers. Typically, the objects are acquired from a writer
  271. in order to prepare a XIPIMAGE for appending to that writer. This is usually done by getting
  272. the DOCUMENTWRITER's list of TRANSFORMSPECs with a call to refSpecs. The specification may
  273. be tailored as needed, by calls to setPageSpec and setRasterSpec. Finally, the TransformPage
  274. function is used to prepare a given XIPIMAGE for the desired specification.
  275. }
  276.  
  277.  
  278.  
  279. <FUNCTIONS>
  280. function: XIPXMLtoXPSXML Native=XIPXML2XPSXML@documentio \
  281.                          Input=xipxml.s, width.d, height.d, xres.d, yres.d, matrix.LIST \
  282.                          Output=xpsxml.s, font.s \
  283.                          DESC=Converts internal XML OCR format to XML for XPS container. The ratio between \
  284.                          width(height) and the width(height) embedded in xipxml determine the x(y)-scaling \
  285.                          performed during output. Returned value is a STRING object.
  286.  
  287. function: XIPXMLtoText   Native=XIPXML2Text@documentio \
  288.                          Input=xipxml.s \
  289.                          Output=text.s \
  290.                          DESC=Converts internal XIPXML OCR text to simple text with trying to account for \
  291.                          text positioning by adding spaces and carriage returns.
  292.  
  293. function: CreateDocumentReader Native=MakeDocReader@documentio \
  294.                         Input=filename.STRING, password.STRING \
  295.                         Output=docrd.DOCUMENTREADER \
  296.                         Desc=The object returned will support the file format found in \
  297.                         the given file. No object will be returned if the format is not \
  298.                         supported or if the file can not be accessed.
  299.  
  300. function: CreateDocumentWriter Native=MakeDocWriter@documentio \
  301.                         Input=filename.STRING, format.STRING, subtype.STRING, testfile.BOOLEAN, password.STRING \
  302.                         Output=docwt.DOCUMENTWRITER \
  303.                         Desc=A new writer will be returned which supports the file format needed. \
  304.                         The file format is determined by first looking for a format. If no format \
  305.                         has been named, the extension of the filename is used. The version is optional. \
  306.                         Formats are; TIFF (versions - v6 or tn2); TIFFFX (versions - S,F,C); PDF \
  307.                         (versions - 1.3, 1.4, 1.7); JFIF; and standard XE writers.
  308.  
  309. function: PDFDecompose Native=PDFDecompose@documentio \
  310.                         Input=filename.STRING, destname.STRING, password.STRING \
  311.                         Output=pgcnt.INTEGER \
  312.                         Desc=Parse and decompse a PDF file into a text files that contain \
  313.                         information about objects in the PDF file.
  314.